snapshot: Don't create blur nodes with radius 0
authorTimm Bäder <mail@baedert.org>
Fri, 8 Dec 2017 15:58:06 +0000 (16:58 +0100)
committerTimm Bäder <mail@baedert.org>
Sat, 9 Dec 2017 12:14:51 +0000 (13:14 +0100)
gtk/gtksnapshot.c

index a9882db1510262bb84b496897e6805bbdad313a6..ac18bb514c2320f316dd1b85ccc5505d05eea601 100644 (file)
@@ -346,12 +346,18 @@ gtk_snapshot_collect_blur (GtkSnapshot      *snapshot,
                            const char     *name)
 {
   GskRenderNode *node, *blur_node;
+  double radius;
 
   node = gtk_snapshot_collect_default (snapshot, state, nodes, n_nodes, name);
   if (node == NULL)
     return NULL;
 
-  blur_node = gsk_blur_node_new (node, state->data.blur.radius);
+  radius = state->data.blur.radius;
+
+  if (radius == 0.0)
+    return node;
+
+  blur_node = gsk_blur_node_new (node, radius);
   if (name)
     gsk_render_node_set_name (blur_node, name);